{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "iris=datasets.load_iris()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['data', 'target', 'target_names', 'DESCR', 'feature_names'])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 4)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['setosa', 'versicolor', 'virginica'], dtype='<U10')"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.target_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['sepal length (cm)',\n",
       " 'sepal width (cm)',\n",
       " 'petal length (cm)',\n",
       " 'petal width (cm)']"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.feature_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Iris Plants Database\\n====================\\n\\nNotes\\n-----\\nData Set Characteristics:\\n    :Number of Instances: 150 (50 in each of three classes)\\n    :Number of Attributes: 4 numeric, predictive attributes and the class\\n    :Attribute Information:\\n        - sepal length in cm\\n        - sepal width in cm\\n        - petal length in cm\\n        - petal width in cm\\n        - class:\\n                - Iris-Setosa\\n                - Iris-Versicolour\\n                - Iris-Virginica\\n    :Summary Statistics:\\n\\n    ============== ==== ==== ======= ===== ====================\\n                    Min  Max   Mean    SD   Class Correlation\\n    ============== ==== ==== ======= ===== ====================\\n    sepal length:   4.3  7.9   5.84   0.83    0.7826\\n    sepal width:    2.0  4.4   3.05   0.43   -0.4194\\n    petal length:   1.0  6.9   3.76   1.76    0.9490  (high!)\\n    petal width:    0.1  2.5   1.20  0.76     0.9565  (high!)\\n    ============== ==== ==== ======= ===== ====================\\n\\n    :Missing Attribute Values: None\\n    :Class Distribution: 33.3% for each of 3 classes.\\n    :Creator: R.A. Fisher\\n    :Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)\\n    :Date: July, 1988\\n\\nThis is a copy of UCI ML iris datasets.\\nhttp://archive.ics.uci.edu/ml/datasets/Iris\\n\\nThe famous Iris database, first used by Sir R.A Fisher\\n\\nThis is perhaps the best known database to be found in the\\npattern recognition literature.  Fisher\\'s paper is a classic in the field and\\nis referenced frequently to this day.  (See Duda & Hart, for example.)  The\\ndata set contains 3 classes of 50 instances each, where each class refers to a\\ntype of iris plant.  One class is linearly separable from the other 2; the\\nlatter are NOT linearly separable from each other.\\n\\nReferences\\n----------\\n   - Fisher,R.A. \"The use of multiple measurements in taxonomic problems\"\\n     Annual Eugenics, 7, Part II, 179-188 (1936); also in \"Contributions to\\n     Mathematical Statistics\" (John Wiley, NY, 1950).\\n   - Duda,R.O., & Hart,P.E. (1973) Pattern Classification and Scene Analysis.\\n     (Q327.D83) John Wiley & Sons.  ISBN 0-471-22361-1.  See page 218.\\n   - Dasarathy, B.V. (1980) \"Nosing Around the Neighborhood: A New System\\n     Structure and Classification Rule for Recognition in Partially Exposed\\n     Environments\".  IEEE Transactions on Pattern Analysis and Machine\\n     Intelligence, Vol. PAMI-2, No. 1, 67-71.\\n   - Gates, G.W. (1972) \"The Reduced Nearest Neighbor Rule\".  IEEE Transactions\\n     on Information Theory, May 1972, 431-433.\\n   - See also: 1988 MLC Proceedings, 54-64.  Cheeseman et al\"s AUTOCLASS II\\n     conceptual clustering system finds 3 classes in the data.\\n   - Many, many more ...\\n'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.DESCR"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "X=iris.data[:,:2]\n",
    "r=iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x251ac9b0ba8>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3X+QHPWZ3/H3s7tGIDC7BlTBltCug1KXu/PBmt0yOKROi6XkcEzJV3WkggsnhrpDCfLlZKGUA0cZFFLUletSh3XnACXhCvikO7hwvgu+MsH80PouVTmldrEAc6JicZb4HdbIEmB+2Np58kfPSDOjme2e6Z6eb/d8XlVdu93T0/30V6tnv/vtZ75t7o6IiJTLUL8DEBGR7Cm5i4iUkJK7iEgJKbmLiJSQkruISAkpuYuIlJCSu4hICSm5i4iUkJK7iEgJjSTd0cyGgTngZXe/oum1a4DfB16ubvq6u9+z1PHOOeccn5iY6ChYEZFBNz8//2N3XxG3X+LkDmwG9gNntnn9AXf/7aQHm5iYYG5uroPTi4iImR1Ksl+iYRkzWwV8BliyNy4iImFIOub+NeDLQGWJfX7DzJ42swfN7L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HB1Gv6CLgLnf/OPBT4MamfUJoyyRxhtCeAJjZKcAG4L+3ernFtr6U4sXE2ff2NLMPEfXMPwp8BDjdzD7fvFuLt3bUnqVO7sClwAYzOwjcD3zKzHbV7+Dub7j7+9XVncBUviE2xPJK9evrwF8An2ja5SWg/i+LVZz851xPxcXo7m+6+9vV778DfMDMzskzRqJ2esnd91bXHyRKos379LUtSRBnIO1Z82ngSXf/fy1eC6E9a9rGGUh7rgd+5O4L7v5z4FvAP2na53h7VoduRoHDnZyk1Mnd3W9y91XuPkH0Z9oT7t7wG7JpXHADsD/HEOvjON3MPlj7HvjnwA+adnsI+DfVyoRLiP6cezWkGM3s3NrYoJl9guhn7I28YgRw99eAF83sF6qb1gF/17RbX9syaZwhtGedz9F+qKPv7VmnbZyBtOcLwCVmtrwayzpOzjsPAV+ofn8lUe7qqOc+kjrMAjKz24A5d38I+B0z2wAcI/rNeE2fwvoHwF9Uf+5GgD9x9/9pZv8OwN3vBr5DVJVwAHgHuDbAGK8ErjezY8C7wFWd/lBm5N8Du6t/ov89cG1gbZk0ziDa08yWA/8M+Ld124JrzwRx9r093X2vmT1INER0DPg+sKMpL30D+GMzO0CUl671nLXSAAAAPUlEQVTq9Dz6hKqISAmVelhGRGRQKbmLiJSQkruISAkpuYuIlJCSu4hICSm5i4iUkJK7iEgJKbmLiJTQ/wcD+3oCshdrMwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x251ac962a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[r==0,0],X[r==0,1],color='red',marker='o')\n",
    "plt.scatter(X[r==1,0],X[r==1,1],color='green',marker='x')\n",
    "plt.scatter(X[r==2,0],X[r==2,1],color='blue',marker='+')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "X=iris.data[:,2:]\n",
    "r=iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x251aca813c8>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAHEdJREFUeJzt3W+QXNV55/Hv0zMjJBk0QyGVBOLPeBM2VeBaxhpFRDYOswsJsk2ZVG2qggsni8uxKAgeDcKVNXbAgoSFvAhIMgGvZGFso8W7a5IUSwAZry1ssvHAjHaIA3KqWAeCBBICRwMIEDPdz77o7qG75/b07bk9ff/071PVpenT5/Z9WhSPzpx+zjnm7oiISLbk4g5ARERaT8ldRCSDlNxFRDJIyV1EJIOU3EVEMkjJXUQkg5TcRUQySMldRCSDlNxFRDKoO64bL1++3Pv7++O6vYhIKo2Pj7/m7isa9Ystuff39zM2NhbX7UVEUsnMXgzTT9MyIiIZpOQuIpJBSu4iIhmk5C4ikkFK7iIiGaTkLiKSQUruIiIZ1DC5m9kZZvYjM9tvZs+a2aaAPkNmNmlmE6XHTQsTroik3dBQ8dHK66O+ZxaFWcQ0DVzv7vvM7CRg3Mwed/fnavr9xN0vbX2IIiLSrIbJ3d1fAV4p/fymme0HVgO1yV1EpK7yyPqJJ6qf7907/+snJmBgYP7vmWVNzbmbWT/wYWA04OX1ZvaMmT1qZufWuX6jmY2Z2diRI0eaDlZERMIxdw/X0exE4AngVnf/q5rXlgEFd3/LzD4BbHP3s+d6v7Vr17r2lhHpPFFH10HXd9KI3czG3X1to36hRu5m1gM8COyuTewA7v6Gu79V+vkRoMfMljcZs4iItEjDOXczM2AXsN/d76jTZxVw2N3dzNZR/Efj9ZZGKiKZEH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VczsAWAIWG5mB4CvuvuueKOat48Cvw/8rDRXDfBld38kxpjm61TgW6Vv/nPA/3D3VJcQZsRK4K9Lp152A//N3R+LN6RIvgDsLk1n/AL4bMzxzJuZLQV+C7hqQd4/baWQIiLSmKZlREQySMldRCSDlNxFRDJIyV1EJIOU3EVEMkjJXUQkg5TcRUQySMldRCSD/j/9EDoYKMGTcwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x251aca20b70>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[r==0,0],X[r==0,1],color='red',marker='o')\n",
    "plt.scatter(X[r==1,0],X[r==1,1],color='green',marker='x')\n",
    "plt.scatter(X[r==2,0],X[r==2,1],color='blue',marker='+')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5, 1.5, 1.6, 1.4,\n",
       "       1.1, 1.2, 1.5, 1.3, 1.4, 1.7, 1.5, 1.7, 1.5, 1. , 1.7, 1.9, 1.6,\n",
       "       1.6, 1.5, 1.4, 1.6, 1.6, 1.5, 1.5, 1.4, 1.5, 1.2, 1.3, 1.5, 1.3,\n",
       "       1.5, 1.3, 1.3, 1.3, 1.6, 1.9, 1.4, 1.6, 1.4, 1.5, 1.4, 4.7, 4.5,\n",
       "       4.9, 4. , 4.6, 4.5, 4.7, 3.3, 4.6, 3.9, 3.5, 4.2, 4. , 4.7, 3.6,\n",
       "       4.4, 4.5, 4.1, 4.5, 3.9, 4.8, 4. , 4.9, 4.7, 4.3, 4.4, 4.8, 5. ,\n",
       "       4.5, 3.5, 3.8, 3.7, 3.9, 5.1, 4.5, 4.5, 4.7, 4.4, 4.1, 4. , 4.4,\n",
       "       4.6, 4. , 3.3, 4.2, 4.2, 4.2, 4.3, 3. , 4.1, 6. , 5.1, 5.9, 5.6,\n",
       "       5.8, 6.6, 4.5, 6.3, 5.8, 6.1, 5.1, 5.3, 5.5, 5. , 5.1, 5.3, 5.5,\n",
       "       6.7, 6.9, 5. , 5.7, 4.9, 6.7, 4.9, 5.7, 6. , 4.8, 4.9, 5.6, 5.8,\n",
       "       6.1, 6.4, 5.6, 5.1, 5.6, 6.1, 5.6, 5.5, 4.8, 5.4, 5.6, 5.1, 5.1,\n",
       "       5.9, 5.7, 5.2, 5. , 5.2, 5.4, 5.1])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
